package com.hightrast.service.compareToData.stage.impl;

import com.hightrast.service.api.entity.RastProducts;
import com.hightrast.service.compareToData.stage.EntityUpdater;
import com.hightrast.service.util.BaseEntityUtil;

/**
 *  商品 更新策略实现
 */
public class RastProductUpdater implements EntityUpdater<RastProducts> {
    @Override
    public void updateEntity(RastProducts oldEntity, RastProducts newEntity) {
        oldEntity.setTitle(newEntity.getTitle());
        oldEntity.setVendor(newEntity.getVendor());
        oldEntity.setProductType(newEntity.getProductType());
        oldEntity.setUpdatedAt(newEntity.getUpdatedAt());
        oldEntity.setPublishedAt(newEntity.getPublishedAt());
        oldEntity.setPublishedScope(newEntity.getPublishedScope());
        oldEntity.setTags(newEntity.getTags());
        oldEntity.setStatus(newEntity.getStatus());
        BaseEntityUtil.update(oldEntity);
    }
}